package com.pingbu.tijian.hospital.backapi.api;

import com.github.pagehelper.PageInfo;
import com.pingbu.common.bean.ResultBean;
import com.pingbu.tijian.hospital.backapi.bean.entity.StudentGroup;
import com.pingbu.tijian.hospital.backapi.bean.entity.UserInfo;
import com.pingbu.tijian.hospital.backapi.service.StudentGroupService;
import com.pingbu.tijian.hospital.backapi.service.UserInfoService;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.Filter;
import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("/student_group")
public class StudentGroupController {

    private static Logger logger = LoggerFactory.getLogger(StudentGroupController.class);

    @Autowired
    private UserInfoService userService;
    @Autowired
    private StudentGroupService studentGroupService;

    /**
     *
     * @return
     */
    @PostMapping(value = "/list")
    public ResultBean<List<StudentGroup>> list(@RequestBody StudentGroup param ) {
        ResultBean<List<StudentGroup>> rb1 = studentGroupService.list(param);
        return rb1;
    }

    @PostMapping(value = "/add")
    public ResultBean<Integer> add(@RequestBody StudentGroup param) {
        ResultBean<Integer> rb = studentGroupService.add(param);
        return rb;
    }

    @PostMapping(value = "/delete")
    public ResultBean<Integer> delete(@RequestBody StudentGroup param) {
        ResultBean<Integer> rb = studentGroupService.delete(param);
        return rb;
    }

    @PostMapping(value = "/update")
    public ResultBean<Integer> update(@RequestBody StudentGroup param) {
        ResultBean<Integer> rb = studentGroupService.update(param);
        return rb;
    }


}
